import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";
import NFTsView from "../views/NFTsView.vue";
import RisksView from "../views/RisksView.vue";
import UsersView from "../views/UsersView.vue";
import LoginView from "../views/LoginView.vue";
import AdminView from "../views/AdminView.vue";
import WidthdrawView from "../views/WidthdrawView.vue";
import CheckView from "../views/CheckView.vue";
import CustomerService from "../views/CustomerService";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "home",
    meta: "官方数据",
    component: HomeView,
  },
  {
    path: "/login",
    name: "login",
    meta: "",
    component: LoginView,
  },
  {
    path: "/nfts",
    name: "nfts",
    meta: "NFT数据",
    component: NFTsView, //() => import('../views/NFTsView.vue')
  },
  {
    path: "/risks",
    meta: "风控流水",
    name: "risks",
    component: RisksView,
  },
  {
    path: "/users",
    name: "users",
    meta: "用户数据",
    component: UsersView,
  },
  {
    path: "/wd",
    name: "wd",
    meta: "提取记录",
    component: WidthdrawView,
  },
  {
    path: "/admin",
    name: "admin",
    meta: "管理员",
    component: AdminView,
  },
  {
    path: "/CheckView",
    name: "CheckView",
    meta: "视频审核",
    component: CheckView,
  },
  {
    path: "/CustomerService",
    name: "CustomerService",
    meta: "客服专区",
    component: CustomerService,
  },
];

const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
};

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes,
});

export default router;
